<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="__STATIC__/lib/html5shiv.js"></script>
<script type="text/javascript" src="__STATIC__/lib/respond.min.js"></script>
<![endif]-->
<link rel="stylesheet" type="text/css" href="__STATIC__/h-ui/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="__STATIC__/h-ui.admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="__STATIC__/lib/Hui-iconfont/1.0.8/iconfont.css" />
<link rel="stylesheet" type="text/css" href="__STATIC__/h-ui.admin/skin/default/skin.css" id="skin" />
<link rel="stylesheet" type="text/css" href="__STATIC__/h-ui.admin/css/style.css" />
<!--[if IE 6]>
<script type="text/javascript" src="__STATIC__/lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title>评价管理</title>
<style>
	h3{
		background-color: #eeeeee;
	}
	.panel-body{
		background-color: #eeeeee;
	}
	tbody{
		background-color: #fff;
	}
</style>
</head>
<body>

<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 评价管理 <span class="c-gray en">&gt;</span> 评价详情页 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>

<div class="page-container">
	<div class="mt-20">
<div class="wrapper">
    <section class="content">
    <div class="row">
      <div class="col-xs-12">
        <div class="box">
           
        <!--新订单列表 基本信息-->
        <div class="panel panel-default">
            <div class="panel-heading">
                <h3 class="panel-title text-center">基本信息</h3>
            </div>
            <div class="panel-body">
                <table class="table table-bordered">
                    <tbody>
                    <tr>
                        <td>订单 ID:</td>
                        <td>订单号:</td>
                        <td>收货人:</td>
                        <td>电话:</td>
                        <td>应付:</td>
                        <td>订单 状态:</td>
                        <td>下单时间:</td>                       
                    </tr>
                   <?php foreach ($data as $key => $v): ?>
                   	<tr>
                        <td>{$v.order_id}</td>
                        <td>{$v.order_sn}</td>
                        <td>{$v.receiver}</a></td>
                        <td>{$v.tel}</td>
                        <td>￥{$v.price}</td>
						<td>
							<?php if ($v['status'] == 0){ ?>
								<span>已取消</span>
							<?php } ?>

							<?php elseif ($v['status'] == 1){ ?>
								<span>未付款</span>
							<?php } ?>

							<?php elseif ($v['status'] == 2){ ?>
								<span>待发货</span>
							<?php } ?>

							<?php elseif ($v['status'] == 3){ ?>
								<span>待收货</span>
							<?php } ?>

							<?php elseif ($v['status'] == 4){ ?>
								<span>待评价</span>
							<?php } ?>
							
							<?php elseif ($v['status'] == 5){ ?>
								<span>申请退款</span>
							<?php } ?>

							<?php elseif ($v['status'] == 6){ ?>
								<span>已退款</span>
							<?php } ?>

							<?php elseif ($v['status'] == 7){ ?>
								<span>交易完成</span>
							<?php } ?>

							<?php elseif ($v['status'] == 8){ ?>
								<span>交易关闭</span>
							<?php } ?>
							
						</td>
						<td>{$v.addtime}</td>
						
                    </tr>
                   <?php endforeach ?>
                    
                    </tbody>
                </table>
            </div>
        </div>
		<br>
        <div class="panel panel-default">
            <div class="panel-heading">
                <h3 class="panel-title text-center">收货人信息</h3>
            </div>
            <div class="panel-body">
                <table class="table table-bordered">
                    <tbody>
                    <tr>
	                    <td>收货人:</td>
	                    <td>联系方式:</td>
	                    <td>地址:</td>
                    </tr>
                   <?php foreach ($result as $key => $v): ?>
                   	<tr>
                        <td>{$v.receiver}</td>
                        <td>{$v.tel}</td>
                        <td>{$v.address}</a></td>
                    </tr>
                   <?php endforeach ?>      

                    </tbody>
                </table>
            </div>
        </div>
        <br>
        <div class="panel panel-default">
            <div class="panel-heading">
                <h3 class="panel-title text-center">商品信息</h3>
            </div>
            <div class="panel-body">
                <table class="table table-bordered">
                    <tbody>
                     <tr>
                        <td class="text-left">商品</td>
                        <td class="text-left">顏色</td>
                        <td class="text-right">数量</td>
                        <td class="text-right">单品价格</td>
                        <td>是否退款</td>
                    </tr>
                   <?php foreach ($res as $key => $v): ?>
                   	<tr>
                        <td>{$v.name}</td>
                        <td>{$v.attrvalue}</td>
                        <td>{$v.num}</a></td>
                        <td>￥{$v.price_one}</a></td>
						<?php if ($v['order_status'] == 0 || $v['order_status'] == 1){ ?>
							<td class="td-status">
								<?php if ($v['order_status'] == 0){ ?>
										<span class="label label-success radius status" name="order_status" value="1" where="<?php echo $v['id'] ?>">申请退款</span>
								<?php } ?>
								<?php else{ ?>
									<span class="label label-success radius status" name="order_status" value="0" where="<?php echo $v['id'] ?>">已退款</span>
								<?php } ?>
							</td>
						<?php } ?>
						<?php if ($v['order_status'] != 0 || $v['order_status'] != 1){ ?>
								<?php if ($v['order_status'] == 0){ ?>
										<span class="label label-success radius status" name="order_status" value="1" where="<?php echo $v['id'] ?>"></span>
								<?php } ?>
								<?php else{ ?>
									<span class="label label-success radius status" name="order_status" value="0" where="<?php echo $v['id'] ?>"></span>
								<?php } ?>
						<?php } ?>
					
                    </tr>
                   <?php endforeach ?>
                    

                    </tbody>
                </table>
            </div>
        </div>
</body>
<script>

</script>
</html>
       
		
	</div>
</div>
<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="__STATIC__/lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="__STATIC__/lib/layer/2.4/layer.js"></script>
<!-- <script type="text/javascript" src="__STATIC__/static/h-ui/js/H-ui.min.js"></script>
<script type="text/javascript" src="__STATIC__/static/h-ui.admin/js/H-ui.admin.js"></script> -->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="__STATIC__/lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript" src="__STATIC__/lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="__STATIC__/lib/laypage/1.2/laypage.js"></script>
<script type="text/javascript">

 $(document).on("click",".status",function(){
	var order_status = $(this).attr("value");
	var id = $(this).attr("where");

	var _this = $(this);
	$.ajax({
		url:"{:url('index/order/status')}",
		type:"post",
		dataType:"json",
		data:{order_status:order_status,id:id},
		success:function(res){
			console.log(res);
			if(res == '0'){
				_this.empty();
				_this.text("已退款");
				_this.attr("value",1);
				alert(_this.text());

				
			}
		}
	})
})

</script>
</body>
</html>
